package com.feihao.zhou.classLoadDemo;

import java.io.*;
import java.lang.annotation.Annotation;
import java.util.Properties;

public class ClassLoadDemo02 {
    public static void main(String[] args) throws IOException {
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();

        //以流的方式读取文件:
        //利用加载器加载指定文件
        InputStream resourceAsStream = systemClassLoader.getResourceAsStream(   //文件一定要放在src目录下！！
                "777.properties");

        //创建集合对象加载读取的数据
        Properties prop = new Properties();
        prop.load(resourceAsStream);

        System.out.println(prop);

        resourceAsStream.close();


    }
}
